import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/navigate',
    children:[
      {path: '/navigate',component: () => import('../views/NavigateView.vue')},
      {path: '/examL',component: () => import('../views/exam/ExamListView.vue')},
      {path: '/examM',component: () => import('../views/exam/ExamManageView.vue')},
      {path: '/examP',component: () => import('../views/exam/ExamPrepareView.vue')},
      {path: 'examA',component: () => import('../views/exam/ExamAnswerView.vue')},
      {path: '/questionM',component: () => import('../views/question/QuestionManageView.vue')},
      {path: '/questionL',component: () => import('../views/question/QuestionListView.vue')},
      {path: '/scoreQ',component: () => import('../views/score/ScoreQueryView.vue')},
      {path: '/studentM',component: () => import('../views/student/StudentManageView.vue')},
      {path: '/scoreQ',component: () => import('../views/score/ScoreQueryView.vue')},
      {path: '/teacherM',component: () => import('../views/teacher/TeacherManage.vue')},
    ]
  },
  {path: '/login',component: () => import('../views/user/LoginView.vue')},
  {path: '/register',component: () => import('../views/user/RegisterView.vue')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
